package com.example.configclient.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@Controller
@RefreshScope
public class ProductController {
    @Value("${from}")
    private String from;
    @GetMapping("/api/version")
    public String getFromValue(Model model){
        model.addAttribute("version",from);
        return "products";
    }
}
